package cn.iocoder.devlop.module.annual.report.shouldknow.dal;

import cn.iocoder.devlop.framework.common.pojo.PageResult;
import cn.iocoder.devlop.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.devlop.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.devlop.module.annual.report.shouldknow.controller.vo.ShouldKnowExportReqVO;
import cn.iocoder.devlop.module.annual.report.shouldknow.controller.vo.ShouldKnowPageReqVO;
import cn.iocoder.devlop.module.annual.report.shouldknow.dal.dataobject.ShouldKnowDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 填报须知 Mapper
 *
 * @author sunhao
 */
@Mapper
public interface ShouldKnowMapper extends BaseMapperX<ShouldKnowDO> {

    default PageResult<ShouldKnowDO> selectPage(ShouldKnowPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShouldKnowDO>()
                .eqIfPresent(ShouldKnowDO::getEnttype, reqVO.getEnttype()));
    }

    default List<ShouldKnowDO> selectList(ShouldKnowExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShouldKnowDO>()
                .eqIfPresent(ShouldKnowDO::getEnttype, reqVO.getEnttype())
                .likeIfPresent(ShouldKnowDO::getContent, reqVO.getContent())
                .orderByDesc(ShouldKnowDO::getId));
    }

}
